public class RtSum {
    public static int sumEvery(int n) {
        if(n < 10)  return n;
        int ret = n % 10 + sumEvery(n/10);
        return ret;
    }

    public static void main(String[] args) {
        int a = sumEvery(1729);
        System.out.println(a);
    }
}
